import { createApp } from 'vue'
import { createI18n } from 'vue-i18n'
import Toast from "vue-toastification";
import "vue-toastification/dist/index.css";
import App from './App.vue'
import zhLocale from './locales/zh.js'
import enLocale from './locales/en.js'

const i18n = createI18n({
  legacy: false,
  locale: 'zh',
  fallbackLocale: 'en',
  messages: {
    zh: zhLocale,
    en: enLocale
  }
})

// 添加高德地图安全配置
window._AMapSecurityConfig = {
  securityJsCode: import.meta.env.VITE_AMAP_SECRET
}

const app = createApp(App)
app.use(i18n)
app.use(Toast)
app.mount('#app')
